package com.leyou.auth.confin;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClient;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class OssConfig {

    @Bean
    public OSS ossClient(AliOSSProperties prop){
        //已过时
//        return  new OSSClient(prop.getEndpoint(),prop.getAccessKeyId(),prop.getAccessKeySecret());
    return new OSSClientBuilder().build(prop.getEndpoint(),prop.getAccessKeyId(),prop.getAccessKeySecret());
    }
}
